package com.buding.fx.controller.codeformat;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * @Author: mingdongwei
 * @Date: 2024-05-02
 * @Description:
 * @Version: 1.0.0
 */
public class CodeFormatMySqlController implements Initializable {
    private Logger logger = LoggerFactory.getLogger(CodeFormatMySqlController.class);

    @FXML
    private ScrollPane mysqlPane;

    private Stage stage;

    private Scene scene;

    public Stage getStage() {
        return stage;
    }

    public void setStage(Stage stage) {
        this.stage = stage;
    }


    @Override
    public void initialize(URL location, ResourceBundle resources) {
        logger.info("mysql controller  init");
    }

    public void resize(){
        Scene scene = stage.getScene();
        double rootweight = scene.getWidth();
        double rootHeight = scene.getHeight();
        mysqlPane.setMaxWidth(rootweight);
        mysqlPane.setMaxHeight(rootHeight);
    }
}
